package com.nineclock.sign.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.sign.pojo.SignInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

public interface SignMapper extends BaseMapper<SignInfo> {
    //查询员工的所有签到信息

    @Select("SELECT count(company_user_id) FROM sign_info WHERE company_user_id=#{companyUserId} and create_date=#{format} group by company_user_id")
    Integer getCompanyUser(@Param("companyUserId") Long companyUserId, @Param("format") String format);

    //查询当前用户的所有签到数据
    @Select("select * from sign_info where company_user_id=#{companyUserId} ")
    List<SignInfo> getSign(Long companyUserId);
}
